<template>
  <el-card class="content small-padding-card">
    <top-label v-model="index" class="move-up">
      <span :slot="0">监测点变形分析</span>
      <span :slot="1">监测点变形速率分析</span>
      <span :slot="2">同级子坝变形速率分析</span>
      <span :slot="3">累计变形分析</span>
      <span :slot="4">人工与自动化对比</span>
      <span :slot="5">数据统计</span>
    </top-label>
    <cumulative-analysis-chart
      v-if="index === 0"
      :node="node"
    ></cumulative-analysis-chart>
    <single-point-analysis
      v-if="index === 1"
      :node="node"
    ></single-point-analysis>
    <cumparison-warning v-if="index === 2" :node="node"></cumparison-warning>
    <cumulative-deformation-analysis
      v-if="index === 3"
      :node="node"
    ></cumulative-deformation-analysis>
    <same-level v-if="index === 4" :node="node"></same-level>
    <data-statistics v-if="index === 5" :node="node"></data-statistics>
  </el-card>
</template>

<script>
import TopLabel from "~/components/TopLabel";
import SameLevel from "~/views/monitor-control/statistical-analysis/surface-displacement/SameLevel";
import CumulativeAnalysisChart from "~/views/monitor-control/statistical-analysis/surface-displacement/CumulativeAnalysisChart";
import SinglePointAnalysis from "~/views/monitor-control/statistical-analysis/surface-displacement/SinglePointAnalysis";
import DataStatistics from "~/views/monitor-control/statistical-analysis/surface-displacement/DataStatistics";
import CumulativeDeformationAnalysis from "~/views/monitor-control/statistical-analysis/surface-displacement/CumulativeDeformationAnalysis";
import CumparisonWarning from "../../../views/monitor-control/statistical-analysis/surface-displacement/CumparisonWarning";
export default {
  name: "SurfaceDisplacement",
  components: {
    DataStatistics,
    SinglePointAnalysis,
    CumulativeAnalysisChart,
    CumparisonWarning,
    TopLabel,
    SameLevel,
    CumulativeDeformationAnalysis,
  },
  props: {
    node: Object,
  },
  data() {
    return {
      index: 0,
    };
  },
  created() {
    if (window.sessionStorage.getItem("indexsu") != null) {
      this.index = Number(window.sessionStorage.getItem("indexsu"));
    }
  },
  methods: {},
  watch: {
    index: function (indexra, oldVal) {
     window.sessionStorage.setItem("indexsu", indexra);
      // console.log(val);
    },
  },
};
</script>

<style scoped>
.content {
  margin-left: 10px;
  padding-top: 5px;
}
.move-up {
  transform: translateY(-5px);
}
</style>
